<template>
  <div class="goods-list-item" @click="itemClick">
      <img :src="goodsitem.show.img" alt="">
      <div class="goods-info">
          <p>{{goodsitem.title}}</p>
          <span class="price">￥{{goodsitem.price}}</span>
          <span class="collect">收藏：{{goodsitem.cfav}}</span>
      </div>
  </div>
</template>

<script>
export default {
  name: "GoodsListItem",
  props:{
      goodsitem:{
          tyep:Object,
          default(){
              return {}
          }
      }
  },
  methods:{
    itemClick(){
        this.$router.push('./detail/'+this.goodsitem.iid)
    }
  }
};
</script>

<style scoped>
.goods-list-item{
    padding-bottom: 40px;
    width: 48%;
}
.goods-list-item img{
    width:100%;
    border-radius: 5px;
}
.goods-info{
    font-size: 12px;
    text-align: center;
}
.goods-info p{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
}
.goods-info .price{
    color:var(--color-high-text);
    margin-right: 20px;
}
.goods-info .collect{
    font-size: 7px;
}
</style>